;Assembler header file for SaveAs
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:07:20 2005
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 5 Sept 1995

        [       :LNOT: :DEF: SaveAs_Hdr
        GBLS    SaveAs_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_Toolbox
        GBLS    Get_Toolbox
        ]
        [       :LNOT: :DEF: Toolbox_Hdr
Get_Toolbox                     SETS    "GET oslib/Toolbox.Hdr"
        |
Get_Toolbox                     SETS    ""
        ]
        $Get_Toolbox

        [       :LNOT: :DEF: Get_Window
        GBLS    Get_Window
        ]
        [       :LNOT: :DEF: Window_Hdr
Get_Window                      SETS    "GET oslib/Window.Hdr"
        |
Get_Window                      SETS    ""
        ]
        $Get_Window

;Symbols for constants
Class_SaveAs                    *       &82BC0
SaveAs_GenerateAboutToBeShown   *       &1
SaveAs_GenerateDialogueCompleted *       &2
SaveAs_NoSelectionButton        *       &4
SaveAs_GivenData                *       &8
SaveAs_ClientSupportsRAMTransfer *       &10
SaveAs_SaveSuccessful           *       &1
SaveAs_SaveSelection            *       &1
SaveAs_SaveSafe                 *       &2
SaveAs_FileIcon                 *       &82BC000
SaveAs_FileName                 *       &82BC001
SaveAs_Cancel                   *       &82BC002
SaveAs_Save                     *       &82BC003
SaveAs_Selection                *       &82BC004
Action_SaveAsAboutToBeShown     *       &82BC0
Action_SaveAsDialogueCompleted  *       &82BC1
Action_SaveAsSaveToFile         *       &82BC2
Action_SaveAsFillBuffer         *       &82BC3
Action_SaveAsSaveCompleted      *       &82BC4
Error_SaveAsTasksActive         *       &80B600
Error_SaveAsAllocFailed         *       &80B601
Error_SaveAsShortBuffer         *       &80B602
Error_SaveAsFileNameTooLong     *       &80B603
Error_SaveAsNoSuchTask          *       &80B611
Error_SaveAsNoSuchMethod        *       &80B612
Error_SaveAsNoSuchMiscOpMethod  *       &80B613
Error_SaveAsNotType1            *       &80B621
Error_SaveAsNotType3            *       &80B623
Error_SaveAsBufferExceeded      *       &80B631
Error_SaveAsDataAddressUnset    *       &80B641
Error_SaveAsNotFullPath         *       &80B642

;Symbols for structure offsets and sizes
                                ^       0
                                #       Bits
SaveAs_Flags                    *       @

                                ^       0
SaveAs_Object_flags             #       SaveAs_Flags
SaveAs_Object_file_name         #       Toolbox_MsgReference
SaveAs_Object_file_type         #       Bits
SaveAs_Object_title             #       Toolbox_MsgReference
SaveAs_Object_title_limit       #       Int
SaveAs_Object_alternative_window_name #       Toolbox_StringReference
SaveAs_Object                   *       @

                                ^       0
SaveAs_ObjectTemplate           Toolbox_ResourceFileObject_MEMBERS
SaveAs_ObjectTemplate_objectflags #       SaveAs_Flags
SaveAs_ObjectTemplate_file_name #       Toolbox_MsgReference
SaveAs_ObjectTemplate_file_type #       Bits
SaveAs_ObjectTemplate_title     #       Toolbox_MsgReference
SaveAs_ObjectTemplate_title_limit #       Int
SaveAs_ObjectTemplate_alternative_window_name #       Toolbox_StringReference
SaveAs_ObjectTemplate           *       @

SaveAs_Full                     *       Toolbox_Full

                                ^       0
SaveAs_ActionAboutToBeShown_tag #       Toolbox_PositionTag
SaveAs_ActionAboutToBeShown_position *       @
SaveAs_ActionAboutToBeShown_position_top_left #       OS_Coord
                                ^       SaveAs_ActionAboutToBeShown_position
SaveAs_ActionAboutToBeShown_position_full #       SaveAs_Full
SaveAs_ActionAboutToBeShown     *       @

                                ^       0
SaveAs_ActionSaveToFile_file_name #       212*Char
SaveAs_ActionSaveToFile         *       @

                                ^       0
SaveAs_ActionFillBuffer_size    #       Int
SaveAs_ActionFillBuffer_buffer  #       Ptr
SaveAs_ActionFillBuffer_size_saved #       Int
SaveAs_ActionFillBuffer         *       @

                                ^       0
SaveAs_ActionSaveCompleted_ref  #       Bits
SaveAs_ActionSaveCompleted_file_name #       208*Char
SaveAs_ActionSaveCompleted      *       @

                                ^       0
SaveAs_ActionAboutToBeShownBlock Toolbox_ActionHeader_MEMBERS
SaveAs_ActionAboutToBeShownBlock_tag #       Toolbox_PositionTag
SaveAs_ActionAboutToBeShownBlock_position *       @
SaveAs_ActionAboutToBeShownBlock_position_top_left #       OS_Coord
                                ^       SaveAs_ActionAboutToBeShownBlock_position
SaveAs_ActionAboutToBeShownBlock_position_full #       SaveAs_Full
SaveAs_ActionAboutToBeShownBlock *       @

SaveAs_ActionDialogueCompletedBlock *       Toolbox_ActionHeaderBase

                                ^       0
SaveAs_ActionSaveToFileBlock    Toolbox_ActionHeader_MEMBERS
SaveAs_ActionSaveToFileBlock_file_name #       212*Char
SaveAs_ActionSaveToFileBlock    *       @

                                ^       0
SaveAs_ActionFillBufferBlock    Toolbox_ActionHeader_MEMBERS
SaveAs_ActionFillBufferBlock_buffer_size #       Int
SaveAs_ActionFillBufferBlock_buffer #       Ptr
SaveAs_ActionFillBufferBlock_size_saved #       Int
SaveAs_ActionFillBufferBlock    *       @

                                ^       0
SaveAs_ActionSaveCompletedBlock Toolbox_ActionHeader_MEMBERS
SaveAs_ActionSaveCompletedBlock_ref #       Bits
SaveAs_ActionSaveCompletedBlock_file_name #       208*Char
SaveAs_ActionSaveCompletedBlock *       @


;Symbols for SWI's and SWI reason codes
XSaveAs_ClassSWI                *       &A2BC0
SaveAs_ClassSWI                 *       &82BC0

XSaveAs_PostFilter              *       &A2BC1
SaveAs_PostFilter               *       &82BC1

XSaveAs_PreFilter               *       &A2BC2
SaveAs_PreFilter                *       &82BC2

SaveAs_GetWindowID              *       &0
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &0
   ;Exit
   ;  R0 = window (Toolbox_O)

SaveAs_SetTitle                 *       &1
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &1
   ;  R3 -> title (String)

SaveAs_GetTitle                 *       &2
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &2
   ;  R3 = buffer (pointer to String)
   ;  R4 = size (Int)
   ;Exit
   ;  R4 = used (Int)

SaveAs_SetFileName              *       &3
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &3
   ;  R3 -> file_name (String)

SaveAs_GetFileName              *       &4
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &4
   ;  R3 = buffer (pointer to String)
   ;  R4 = size (Int)
   ;Exit
   ;  R4 = used (Int)

SaveAs_SetFileType              *       &5
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &5
   ;  R3 = file_type (Bits)

SaveAs_GetFileType              *       &6
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &6
   ;Exit
   ;  R0 = file_type (Bits)

SaveAs_SetFileSize              *       &7
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &7
   ;  R3 = file_size (Int)

SaveAs_GetFileSize              *       &8
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &8
   ;Exit
   ;  R0 = file_size (Int)

SaveAs_SelectionAvailable       *       &9
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &9
   ;  R3 = selection_available (Bool)

SaveAs_SetDataAddress           *       &A
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &A
   ;  R3 = data (pointer to data)
   ;  R4 = size (Int)
   ;  R5 = selection (pointer to data)
   ;  R6 = selection_size (Int)

SaveAs_BufferFilled             *       &B
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &B
   ;  R3 = buffer (pointer to data)
   ;  R4 = size (Int)

SaveAs_FileSaveCompleted        *       &C
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = save_as (Toolbox_O)
   ;  R2 = &C
   ;  R3 -> file_name (String)

        ]
        END
